home *** CD-ROM | disk | FTP | other *** search
/ Windows Expert / Windows Expert.iso / utility / uwserver.zip / uwserver.tar / lib / uw_gvis.c < prev    next >
C/C++ Source or Header  |  1991-01-25  |  1KB  |  55 lines

  1. /*
  2.  *    uw library - uw_gvis, uw_svis
  3.  *
  4.  * Copyright 1986 by John D. Bruner.  All rights reserved.  Permission to
  5.  * copy this program is given provided that the copy is not sold and that
  6.  * this copyright notice is included.
  7.  */
  8. #include "uwlib.h"
  9.  
  10. uw_gvis(uwin, vp)
  11. register UWIN uwin;
  12. register int *vp;
  13. {
  14.     /*
  15.      * Get the visibility status of the window "uwin".  "vp" is a
  16.      * pointer to the integer where the status is returned.
  17.      */
  18.     if (uwin != (UWIN)0) {
  19.         if (vp != (int *)0) {
  20.             *vp = uwin->uwi_vis;
  21.             if (uwin->uwi_ctlfd > 0) {
  22.                 return(0);
  23.             } else {
  24.                 uwerrno = uwin->uwi_uwerr = UWE_NOCTL;
  25.                 return(-1);
  26.             }
  27.         } else {
  28.             uwerrno = uwin->uwi_uwerr = UWE_INVAL;
  29.             return(-1);
  30.         }
  31.     } else {
  32.         uwerrno = UWE_INVAL;
  33.         return(-1);
  34.     }
  35. }
  36.  
  37. uw_svis(uwin, v)
  38. register UWIN uwin;
  39. int v;
  40. {
  41.     union uwoptval optval;
  42.  
  43.     /*
  44.      * Make window "uwin" visible (v != 0) or invisible (v == 0).
  45.      */
  46.     if (uwin != (UWIN)0) {
  47.         uwin->uwi_vis = (v != 0);
  48.         optval.uwov_1bit = uwin->uwi_vis;
  49.         return(uw_optcmd(uwin, UWOP_VIS, UWOC_SET, &optval));
  50.     } else {
  51.         uwerrno = UWE_INVAL;
  52.         return(-1);
  53.     }
  54. }
  55.